package com.yanqu.road.entity.curio.config;

import com.yanqu.road.entity.DataObject;
import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.string.StringUtils;
import org.apache.kafka.common.protocol.types.Field;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_p_curio_suit", desc = "藏品")
public class CurioItemSuitInfo extends DataObject {

    @FieldTypeAnnotation(desc = "ID", select = true, orderASC = true)
    private int id;

    @FieldTypeAnnotation(desc = "藏宝列表")
    private List<Integer> curioList;

    @FieldTypeAnnotation(desc = "套装效果")
    private int skill;

    private int quality;

    @FieldTypeAnnotation(desc = "套装升级消耗类型(1每个藏品满足星级;2藏品总星级)")
    private int skillUpgradeCostType;

    @FieldTypeAnnotation(desc = "其他套装效果，支持多个")
    private String extraSkill;
    private List<Integer> extraSkillList = new ArrayList<>();



    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getQuality() {
        return quality;
    }

    public void setQuality(int quality) {
        this.quality = quality;
    }

    public List<Integer> getCurioList() {
        return curioList;
    }

    public void setCurioList(List<Integer> curioList) {
        this.curioList = curioList;
    }

    public int getSkill() {
        return skill;
    }

    public void setSkill(int skill) {
        this.skill = skill;
    }

    public int getSkillUpgradeCostType() {
        return skillUpgradeCostType;
    }

    public void setSkillUpgradeCostType(int skillUpgradeCostType) {
        this.skillUpgradeCostType = skillUpgradeCostType;
    }

    public String getExtraSkill() {
        return extraSkill;
    }

    public void setExtraSkill(String extraSkill) {
        this.extraSkill = extraSkill;
        if (!StringUtils.isNullOrEmpty(extraSkill) && !extraSkill.equals("0")) {
            this.extraSkillList = StringUtils.stringToIntegerList(extraSkill, ";");
        }
    }

    /**
     * 获取套装技能LIST
     * @return
     */
    public List<Integer> getSkillList() {
        List<Integer> list = new ArrayList<>();
        list.add(this.skill);
        list.addAll(this.extraSkillList);
        return list;
    }
}
